import 'package:flutter/material.dart';
import 'package:flutter_deer/index/models/banner_entity.dart';
import 'package:flutter_deer/index/models/football_ratio_entity.dart';

class IndexPageProvider extends ChangeNotifier {

  /// Tab的下标
  int _index = 0;
  int get index => _index;
  bool? _bannerLoading = true;
  List<BannerEntity>? _bannerList;
  List<FootballRatioGroupEntity>? _groupList;
  List<BannerEntity>? get bannerList => _bannerList;
  List<FootballRatioGroupEntity>? get groupList => _groupList;
  bool? get bannerLoading => _bannerLoading;

  void refresh() {
    notifyListeners();
  }
  
  void setIndex(int index) {
    _index = index;
    notifyListeners();
  }

  void setBannerList(List<BannerEntity>? banners) {
    _bannerList = banners;
    _bannerLoading = false;
    notifyListeners();
  }

  void setFootballRatioGroupList(List<FootballRatioGroupEntity>? groups) {
    _groupList = groups;
    notifyListeners();
  }

}